// Wizard 向导表单

// Variables
$e-wizard-step-label: #959cb6;
$e-wizard-step-icon: #dee1eb;
$e-wizard-step-highlight: e-brand-color();
$e-wizard-step-border: #eeeef4;
$e-wizard-form-bg: #f9fafc;
$e-wizard-form-inner-bg: #fff;

// General mode
.e-wizard {
    flex-direction: column;
    // Nav
    .e-wizard-nav {
        border-bottom: 1px solid $e-wizard-step-border;

        .e-wizard-nav-items {
            display: flex;
            align-items: flex-end;
            padding: 0 4rem;

            .e-wizard-nav-item {
                display: flex;
                align-items: center;
                justify-content: center;
                flex-wrap: wrap;
                flex: 1 1 auto;

                .e-wizard-nav-body {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                    color: $e-wizard-step-label;
                    padding: 2rem .5rem;

                    .e-wizard-nav-label {
                        font-size: 1.1rem;
                        font-weight: 600;
                        margin-bottom: .5rem;

                        span {
                            font-size: 2rem;
                            margin-right: .5rem;
                        }
                    }

                    .e-wizard-nav-bar {
                        height: 4px;
                        width: 100%;
                        background-color: $e-wizard-step-icon;
                        position: relative;

                        &:after {
                            content: ' ';
                            position: absolute;
                            top: 0;
                            left: 0;
                            height: 4px;
                            width: 0;
                            background-color: transparent;
                            transition: $e-transition;
                        }
                    }
                }

                &[data-step-status="current"] {

                    &:after {
                        color: $e-wizard-step-highlight;
                    }

                    .e-wizard-nav-body {
                        color: $e-wizard-step-highlight;

                        .e-wizard-nav-bar {

                            &:after {
                                width: 100%;
                                background-color: $e-wizard-step-highlight;
                            }
                        }
                    }
                }
            }

            @include e-mobile {
                flex-direction: column;
                align-items: flex-start;
                padding: 2rem 0;

                .e-wizard-nav-item {
                    flex: 0 0 100%;
                    position: relative;
                    width: 100%;

                    &:after {
                        position: absolute;
                        right: 2rem;
                    }

                    &:last-child {

                        &:after {
                            content: "\f105";
                            font-family: "Font Awesome 5 Free";
                            font-weight: 900;
                            font-size: 2rem;
                            color: $e-wizard-step-icon;
                        }
                    }

                    .e-wizard-nav-body {
                        justify-content: flex-start;
                        flex: 0 0 100%;
                        padding: .5rem 2rem;
                    }
                }
            }
        }
    }

    .e-wizard-wrapper {
        display: flex;
        justify-content: center;
        background-color: $e-wizard-form-bg;

        .e-form {
            width: 60%;
            padding: 2rem 0 2.5rem;

            .e-wizard-step {
                display: none;
                padding-bottom: 2rem;
                margin-bottom: 2rem;
                border-bottom: 1px solid $e-wizard-step-border;

                .e-wizard-form {
                    margin-top: 3rem;
                }

                &[data-step-status="current"] {
                    display: block;
                }
            }

            .e-form-actions {
                display: flex;
                flex-direction: row;
                justify-content: space-between;

                @include e-mobile-sm {
                    flex-wrap: wrap;
                    justify-content: center;
                }

                .btn {
                    @include e-mobile-sm {
                        margin: 0 .5rem 1rem;
                    }
                }

                .wizard-btn-prev {
                    margin-right: auto;

                    @include e-mobile-sm {
                        margin-right: .5rem;
                    }
                }

                .wizard-btn-next {
                    margin: auto 0 auto auto;

                    @include e-mobile-sm {
                        margin: 0 0 1rem;
                    }
                }
            }
        }

        .e-form--70{
            width: 70%;
        }
        .e-form--80{
            width: 80%;
        }
        .e-form--90{
            width: 90%;
        }
        .e-form--100{
            width: 100%;
        }


        @include e-mobile {
            padding: 2rem;

            .e-form {
                width: 100%;
                padding: 2rem 1rem 4rem;
            }
        }
    }

    &.e-wizard--white {
        .e-wizard-wrapper {
            background-color: $e-wizard-form-inner-bg;
        }
    }


    // 按钮状态
    & {
        .wizard-btn-prev {
            display: none;
        }

        .wizard-btn-next {
            display: inline-block;
        }

        .wizard-btn-submit {
            display: none;
        }
    }

    &[data-wizard-status="between"] {
        .wizard-btn-prev {
            display: inline-block;
        }

        .wizard-btn-next {
            display: inline-block;
        }

        .wizard-btn-submit {
            display: none;
        }
    }

    &[data-wizard-status="last"] {
        .wizard-btn-prev {
            display: inline-block;
        }

        .wizard-btn-next {
            display: none;
        }

        .wizard-btn-submit {
            display: inline-block;
        }
    }
}